package com.lanqiao.javaparkinglot.dao;

import com.lanqiao.javaparkinglot.entity.Yghs;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Mapper
public interface YghsDao {
    //查询
    @Select("select *from tb_yghs")
    List<Yghs> findYghs();
    //添加
    @Update("insert into tb_yghs (hsy_id,hsy_name,hsy_sex,hsy_card,hsy_number,hsy_home,hsy_time,hsy_result) VALUES(#{hsy_id},#{hsy_name},#{hsy_sex},#{hsy_card},#{hsy_number},#{hsy_home},#{hsy_time},#{hsy_result})")
    @Transactional
    void addyghs(Yghs yghs);
    //修改
    @Update("update tb_yghs set hsy_id=#{hsy_id},hsy_name=#{hsy_name},hsy_sex=#{hsy_sex},hsy_card=#{hsy_card},hsy_number=#{hsy_number},hsy_home=#{hsy_home},hsy_time=#{hsy_time},hsy_result=#{hsy_result} where hsy_id=#{hsy_id}")
    @Transactional
    void updateyghs(Yghs yghs);
    //删除
    @Delete("delete from tb_yghs where hsy_id=#{yg_id}")
    void deleteyghs(Long yghs_id);
}
